(* Content-type: application/mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 6.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       145,          7]
NotebookDataLength[     50393,       1425]
NotebookOptionsPosition[     46447,       1294]
NotebookOutlinePosition[     46982,       1317]
CellTagsIndexPosition[     46896,       1312]
WindowFrame->Normal
ContainsDynamic->False*)

(* Beginning of Notebook Content *)
Notebook[{

Cell[CellGroupData[{
Cell["DAQ`DataAcquisition`", "Title",
 PageWidth->WindowWidth,
 CellFrame->{{0, 0}, {2, 0}},
 ShowCellBracket->False,
 FontSize->18,
 FontColor->RGBColor[1, 0.541482, 0.517891],
 Background->Automatic],

Cell[TextData[{
 "This is a package that allows the user to control a National Instruments \
data acquisition card directly from a ",
 StyleBox["Mathematica",
  FontSlant->"Italic"],
 " notebook.  This is accomplished through included C++ code and the Mathlink \
interface with this package.  Help strings are available for all functions \
and their options once the package is loaded.     \n\nThe DAQ folder \
containing the DataAcquisition.m file ( the package ) and the C++ file should \
be placed in the ",
 StyleBox["Mathematica",
  FontSlant->"Italic"],
 "/AddOns/ExtraPackages directory.  To make the file that you are reading \
right now available in the help menu it should be placed in the ",
 StyleBox["Mathematica",
  FontSlant->"Italic"],
 "/Documentation/English/AddOns directory.  In that same directory the \
BrowserCategories.m file should be altered to make this file available in the \
help menu as is explained in the Author Tools subsection of the Add Ons  \
section in the help menu.  It is a good idea to create a backup of the \
BrowserCategories.m file to revert to if you make any mistakes.    "
}], "Text",
 PageWidth->WindowWidth,
 ShowCellBracket->False],

Cell["This loads the package:", "Text",
 PageWidth->WindowWidth,
 ShowCellBracket->False],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Needs", "[", "\"\<DAQ`DataAcquisition`\>\"", "]"}]], "Input",
 PageWidth->WindowWidth],

Cell[BoxData["\<\"C:\\\\Program Files\\\\Wolfram \
Research\\\\Mathematica\\\\6.0\\\\AddOns\\\\ExtraPackages\\\\DAQ\"\>"], \
"Print",
 CellChangeTimes->{3.4095007727547503`*^9, 3.4095010509848256`*^9, 
  3.409501147403469*^9, 3.409501208411194*^9, 3.4095013047096643`*^9, 
  3.4095023809171743`*^9}]
}, Open  ]],

Cell["The available functions and a brief description follow:", "Text",
 PageWidth->WindowWidth,
 ShowCellBracket->False],

Cell[CellGroupData[{

Cell["Importing Voltages", "Subtitle",
 PageWidth->WindowWidth,
 CellFrame->{{0, 0}, {0, 2}},
 CellDingbat->"\[FilledSquare]",
 ShowCellBracket->False,
 FontSize->16,
 FontColor->RGBColor[1, 0.541482, 0.517891]],

Cell["\<\
The most basic function available for recording voltages is the GetVoltages \
function.  It has the following form:\
\>", "Text",
 ShowCellBracket->False],

Cell[BoxData[
 RowBox[{"GetVoltages", "[", 
  StyleBox[
   RowBox[{"channels", ",", "frequency", ",", 
    RowBox[{"number", " ", "of", " ", "samples"}]}],
   FontFamily->"Times",
   FontWeight->"Plain",
   FontSlant->"Italic"], "]"}]], "Input",
 PageWidth->WindowWidth,
 ShowCellBracket->False,
 Evaluatable->False],

Cell["\<\
This function records voltages on the desired channels at the specified \
frequency.  The channels argument must be a one dimensional list of integers \
within a certain range dictated by the National Instruments card and the \
Terminal Mode option (see below, 1 to 8 is the default).  The frequency \
argument must be a positive real number less than 60,000 Hz and the number of \
samples must be a nonnegative integer less than 100,000.  

If a single channel is requested by the user, a simple one-dimensional list \
of pairs (times in seconds and voltages in volts) is returned.  If multiple \
channels are requested a list of lists is returned.  Each element of the list \
of lists corresponds to the channel number called in that order.  For example\
\
\>", "Text",
 PageWidth->WindowWidth,
 ShowCellBracket->False],

Cell[BoxData[
 RowBox[{
  RowBox[{"listy", "=", 
   RowBox[{"GetVoltages", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"7", ",", "1"}], "}"}], ",", "1000", ",", "200"}], "]"}]}], 
  ";"}]], "Input",
 PageWidth->WindowWidth,
 ShowCellBracket->False],

Cell["\<\
returns a list with three elements (themselves being lists).  The first \
element is associated with channel 7 , the second with channel 1 (which is \
simply hooked up to a function generator outputting a sine wave).  To access \
the voltages from channel 1 we can just pick out the list element... Plotting \
is also easily accomplished.\
\>", "Text",
 PageWidth->WindowWidth,
 ShowCellBracket->False],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"ListPlot", "[", 
  RowBox[{
   RowBox[{"listy", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], 
   ",", 
   RowBox[{"Joined", "\[Rule]", "True"}], ",", 
   RowBox[{"AxesLabel", "\[Rule]", 
    RowBox[{"{", 
     RowBox[{"\"\<Seconds\>\"", ",", "\"\<Volts\>\""}], "}"}]}]}], 
  "]"}]], "Input",
 ShowCellBracket->False],

Cell[BoxData[
 GraphicsBox[{{}, {}, 
   {Hue[0.67, 0.6, 0.6], LineBox[CompressedData["
1:eJxdVglQVWUUJiJlkJJIBTE3UEIdR9AxLKNDKoEYhLhEZowx2qCTiqZFTwzE
XMvUDHJDWQRECQWU5YHw9vdQp0id0DEnoMXRK2OoZK7T/f/j/e6Md4Zhztz7
zn++5Xz3Dk9ZnrjI3c3Nzar+if8px8oN+f3TqbP2zpKNF6/T/S+XNK7alU4D
x9d3ZrZfpy+uBYd5lmdQ9ImgyiQfhR6WdZ+LS8kiQ2+/HW+GKjT593e3/bAs
mzYtjL87OkahNf0qojsMX1HfMM+FjnkKGad7u4/ZtJG2vrF+Vv0S5Un/zTRm
SFbMB6sVeu2E67Omg1uJ2iNMs9cqT877hkprH4THb1CobsgGZWbdt6j5/B1U
MXJtxKNMhfbbhh1fmbqTQvMeTyk3aPN8R5nzm+3Ppit0+Z48kBatsLR+tFSb
73vy9pr2q0+qQoPGXRnRa10OjSq3X25O0ebNJeN70R3LPlRo3kLZETXPvxv1
3j3yImvWxmS/BRqeveh/6ae7s/4o3ofzGd9+4B/oMfeFsVV5mJfxHgC+JG5I
a5Y2GouzNfz5uP9O+Ja3FvyVD/6YjwLwcWOm6FhABw8/E++VpvFTCD2+/uTq
g7LuQuBnvoqAZ8ymASqEIujJ/B0C/jMFUTW3H+k181mMfoItf4+Sp/gtwfle
bUVpEV6l9Gpn5JmqlRrfpeDjiIDrcxh4mX+9jhXtBpQBP+tRBn4l3S8fQX+m
8wj0Eey1Bh4FXtbrKPCOmr/d0hNSTq3XtyxePUfTr5wmn4m9cTZRoRa1W8C4
H3Gf9dTr1J1dGTSxAv1Y3wrwoQ6nQj4GPljvY9BrtmoeVVLgYf2Pg59DKntt
RXrNftCfv/PoQvq14Er0Y39U4rxp0gCVwM9+qcS8qngCEPCwf6po1K6z3Wvi
FOLx9Jr9VAV+JsirGjX7q5rM3i1/D05SaL3ptOqg6qf8Vk03Lnm8n7pIofOq
+ionmJ/9p9dBsuEJ6Mt+1O9/KgU4iZr9eRL6W3tCVIVP4nz2aw3m8+UBMT/7
twZ45XSuGiozbFt1Plbzcy3ysCrvZqljhl6zv2vxe3cJuBb8st/rwH8iGwbz
sf/rMH+hgHuhDnryPtQjb26Jdkn1eJ73ox78ThH2v1yP/rwvRswj7ZtsxLy8
P0bg7TAIQYw0l1ofXpqi7VMD6jBp8AaKCd2ZGRap7VcD+FiXM1W1jF7zvjXi
vF8CpcDQg/evEXkzXKR/VyPm5308hf1aIdYjTa95P0/hebNQ9/Yp8M372gS9
fXghyaOiz/IRCdr+NpEpoa8hO0ohSd+9JuDjfW6mqBcv9J40SSE5XkYz5QYl
um+J0PZbr93kZULN+25Cv8OOGepGm8A3778J8yWo26h6FDXngQl8/SfePjYT
+OJ80Ov8ALEQZjzPeWEG3hgpsBn6cH6YMd8/pWJAM0UOfGlD++tanpipuE/O
1u0TFdotpjttpi7Pi765Y7V80WthruneFkrxnPv81fFa3ljQT6TJuTgL+OH8
scBfwi2qZcAP55EF80u4rRbww/lkgb9lO18rnue8ssJ/Mo5mWaE355cV8/Dn
gxV4OS70WsZBm5X+9J3nHxWi5ZuVFg8atG//SIUyZeDYcJ/zTq9fkQtkw/cW
558N/PwsPy9s0IPz0IZ5PxfrcMUGvjgfbdBzqLDzEDv447y0475T2G+BHb/n
/LTj/OUyIO3Ay3lqpwbvPTldoxXykwtvp+jg3wbfCdTy1UEDpiYHFQ1WSI43
Qq85bx14/mN5OcAX568D/cXHk5qw4Ifz2IF5RDqmX3NgHzmfneArWTZ0Ah/n
tV73kgHlBF7Obyf6CTX6VThxPue5E/rJr7ubTsqekJc/Y5iW7y56bs7QkvsB
Cj0W6xbmoluZBUfL+mt5r9clws4rXRS3uD0k0V/Lf/338QwYfPH7wIXz/xVy
9LiwX/x+aEF9QMANbwEefl/o9duSQL3+H+u65ko=
     "]]}},
  AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948],
  Axes->True,
  AxesLabel->{
    FormBox["\"Seconds\"", TraditionalForm], 
    FormBox["\"Volts\"", TraditionalForm]},
  AxesOrigin->{0, 0.84},
  PlotRange->{{0., 0.199}, {0.838931282900145, 0.8600226491378081}},
  PlotRangeClipping->True,
  PlotRangePadding->{
    Scaled[0.02], 
    Scaled[0.02]}]], "Output",
 ShowCellBracket->False,
 CellChangeTimes->{
  3.4095008127122064`*^9, {3.4095010323079696`*^9, 3.409501066246771*^9}}]
}, Open  ]],

Cell["Help strings are available using ?.  ", "Text",
 ShowCellBracket->False],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"?", "GetVoltages"}]], "Input",
 PageWidth->WindowWidth],

Cell[BoxData[
 StyleBox["\<\"GetVoltages[numsamples,samplefreq] returns a list of samples \
from the DAQ\"\>", "MSG"]], "Print", "PrintUsage",
 CellChangeTimes->{3.409500824719472*^9},
 CellTags->"Info3409472023-1192298"]
}, Open  ]],

Cell["\<\
The GetVoltages function also accepts options (as rules) to improve card \
control and flexibility.  They include:\
\>", "Text",
 PageWidth->WindowWidth,
 ShowCellBracket->False],

Cell[BoxData[GridBox[{
   {
    StyleBox["Option",
     FontVariations->{"Underline"->True}], 
    StyleBox[
     RowBox[{"Possible", " ", "Values"}],
     FontVariations->{"Underline"->True}], 
    StyleBox["Description",
     FontVariations->{"Underline"->True}]},
   {
    RowBox[{"Device", "\[IndentingNewLine]"}], 
    RowBox[{"Any", " ", "integer"}], 
    RowBox[{
     RowBox[{
     "Depending", " ", "on", " ", "the", " ", "location", " ", "of", " ", 
      "your", " ", "data", " ", "acquisition", " ", "card", "  ", "you", " ", 
      "may", " ", "want", " ", "to", " ", "specify", " ", "a", " ", 
      "different", " ", "device", " ", 
      RowBox[{"number", ".", "The"}], " ", "default", " ", "is", " ", "1."}], 
     "\[IndentingNewLine]"}]},
   {"TerminalMode", 
    RowBox[{
    "DAQDefault", "\[IndentingNewLine]", "RSE", "\[IndentingNewLine]", 
     "NonRSE", "\[IndentingNewLine]", "Differential", "\[IndentingNewLine]"}],
     
    RowBox[{
     RowBox[{
     "This", " ", "is", " ", "the", " ", "type", " ", "of", " ", "sampling"}],
      ",", 
     RowBox[{"Differential", " ", "is", " ", "the", " ", 
      RowBox[{"default", ".", "  ", "RSE"}], " ", "and", " ", "NonRSE", " ", 
      "are", " ", "referenced", " ", "single", " ", "and", " ", "non", " ", 
      "referenced", " ", "single", " ", "ended", " ", 
      RowBox[{"respectively", ".", " ", "\[IndentingNewLine]", "The"}], " ", 
      "card", " ", "has", " ", "8", " ", "channels", " ", "available", " ", 
      "in", " ", "Differential", " ", "mode", " ", "and", " ", "16", " ", 
      "available", " ", "in", " ", "the", " ", 
      RowBox[{"others", ".", "\[IndentingNewLine]"}]}]}]},
   {
    RowBox[{"MinValue", "\[IndentingNewLine]", "MaxValue"}], 
    RowBox[{
    "Any", " ", "real", " ", "number", " ", "between", " ", "plus", " ", 
     "and", " ", "minus", " ", "10", " ", 
     RowBox[{"(", "volts", ")"}]}], 
    RowBox[{
    "The", " ", "Units", " ", "option", " ", "allows", " ", "you", " ", "to", 
     " ", "use", " ", "the", " ", "default", " ", "of", " ", "volts", " ", 
     "or", " ", "to", " ", "create", " ", "your", " ", "own", " ", "set", " ",
      "of", " ", "units", " ", 
     RowBox[{
      RowBox[{"(", 
       RowBox[{
       "the", " ", "latter", " ", "is", " ", "not", " ", "yet", " ", 
        "implemented"}], ")"}], ".", "\[IndentingNewLine]"}]}]},
   {"ClockSource", "OnboardClock", 
    RowBox[{
    "This", " ", "is", " ", "the", " ", "source", " ", "of", " ", "your", " ",
      "clock", " ", "from", " ", "which", " ", "the", " ", "card", " ", 
     "determines", " ", "the", " ", "sampling", " ", 
     RowBox[{"frequency", ".", "\[IndentingNewLine]"}]}]},
   {"ActiveEdge", 
    RowBox[{"Rising", "\[IndentingNewLine]", "Falling"}], 
    RowBox[{
    "This", " ", "option", " ", "tells", " ", "the", " ", "card", " ", 
     "which", " ", "edge", " ", "to", " ", "listen", " ", "to", " ", "from", 
     " ", "the", " ", "clock", " ", 
     RowBox[{"source", ".", "\[IndentingNewLine]"}]}]},
   {"TimeOut", 
    RowBox[{
     RowBox[{
      RowBox[{"Any", " ", "non"}], "-", 
      RowBox[{"negative", " ", "real", " ", "number", " ", "or"}]}], 
     "\[IndentingNewLine]", "NoTimeOut"}], 
    RowBox[{
    "This", " ", "option", " ", "aborts", " ", "the", " ", "function", " ", 
     "being", " ", "called", " ", "after", " ", "the", " ", "specified", " ", 
     "number", " ", "of", " ", 
     RowBox[{
     "seconds", ".", "\[IndentingNewLine]", "\[IndentingNewLine]"}]}]},
   {"IncludeTime", 
    RowBox[{"Include", "\[IndentingNewLine]", "Omit"}], 
    RowBox[{
    "This", " ", "option", " ", "changes", " ", "the", " ", "form", " ", "of",
      " ", "the", " ", "list", " ", "returned", " ", "upon", " ", "function", 
     " ", 
     RowBox[{"completion", ".", "  ", "The"}], " ", "default", " ", "is", " ",
      "Include", " ", "and", " ", "includes", " ", "the", " ", "times", " ", 
     RowBox[{"(", 
      RowBox[{"in", " ", "seconds"}], ")"}], "that", " ", "correspond", " ", 
     "to", " ", "the", " ", "voltage", " ", "measurements", " ", 
     RowBox[{"(", 
      RowBox[{"in", " ", "volts"}], ")"}], " ", "made", " ", "starting", " ", 
     "at", " ", 
     RowBox[{"zero", ".", "  "}]}]},
   {"MessageLevel", 
    RowBox[{
    "0", "\[IndentingNewLine]", "1", "\[IndentingNewLine]", "2", 
     "\[IndentingNewLine]", "3", "\[IndentingNewLine]", "4", 
     "\[IndentingNewLine]", "5"}], 
    RowBox[{
    "This", " ", "option", " ", "allows", " ", "the", " ", "user", " ", "to", 
     " ", "control", " ", "the", " ", "amount", " ", "of", " ", "interactive",
      " ", "information", " ", "they", " ", 
     RowBox[{"receive", ".", "  ", "Each"}], " ", "higher", " ", "number", 
     " ", "does", " ", "what", " ", "all", " ", "the", " ", "lower", " ", 
     "numbers", " ", "do", " ", "plus", " ", 
     RowBox[{"more", ".", "  ", "0"}], " ", "corresponds", " ", "to", " ", 
     "no", " ", 
     RowBox[{"messages", ".", "  ", "1"}], " ", "corresponds", " ", "to", " ",
      "error", " ", "and", " ", "warning", " ", 
     RowBox[{"messages", ".", "  ", "2"}], " ", "corresponds", " ", "to", " ",
      "potentially", " ", "useful", " ", "reminders", " ", "and", " ", 
     "messages", " ", "and", " ", "is", " ", "the", " ", 
     RowBox[{"default", ".", "  ", "3"}], " ", "returns", "  ", "values", " ",
      "that", " ", "the", " ", 
     RowBox[{"C", "++"}], " ", "code", " ", 
     RowBox[{"received", ".", "  ", "4"}], " ", "returns", " ", "all", " ", 
     "of", " ", "the", " ", "above", " ", "plus", " ", "some", " ", "debug", 
     " ", 
     RowBox[{"messages", ".", " ", "5"}], " ", "returns", " ", "that", " ", 
     "and", " ", 
     RowBox[{"more", "."}]}]}
  }]], "Text",
 PageWidth->WindowWidth,
 CellFrame->True,
 ShowCellBracket->False,
 Background->RGBColor[1, 0.541482, 0.517891],
 GridBoxOptions->{
 GridBoxAlignment->{
  "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, "Rows" -> {{Top}}, 
   "RowsIndexed" -> {}},
 GridBoxDividers->{
  "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, 
   "RowsIndexed" -> {}},
 GridBoxItemSize->{
  "Columns" -> {10, 10, {30}}, "ColumnsIndexed" -> {}, "Rows" -> {{1.}}, 
   "RowsIndexed" -> {}},
 GridBoxSpacings->{"Columns" -> {
     Offset[0.27999999999999997`], {
      Offset[0.5599999999999999]}, 
     Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
     Offset[0.2], {
      Offset[0.6]}, 
     Offset[0.2]}, "RowsIndexed" -> {}}}],

Cell["\<\
The options and their defaults can be viewed using the Options function.\
\>", "Text",
 ShowCellBracket->False],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Options", "[", "GetVoltages", "]"}]], "Input"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"Device", "\[Rule]", "1"}], ",", 
   RowBox[{"TerminalMode", "\[Rule]", "Differential"}], ",", 
   RowBox[{"MinValue", "\[Rule]", 
    RowBox[{"-", "10"}]}], ",", 
   RowBox[{"MaxValue", "\[Rule]", "10"}], ",", 
   RowBox[{"Units", "\[Rule]", "Volts"}], ",", 
   RowBox[{"ClockSource", "\[Rule]", "OnboardClock"}], ",", 
   RowBox[{"ActiveEdge", "\[Rule]", "Rising"}], ",", 
   RowBox[{"SampleMode", "\[Rule]", "Finite"}], ",", 
   RowBox[{"TimeOut", "\[Rule]", "10"}], ",", 
   RowBox[{"MessageLevel", "\[Rule]", "0"}], ",", 
   RowBox[{"IncludeTime", "\[Rule]", "Include"}], ",", 
   RowBox[{"SetupOnly", "\[Rule]", "False"}], ",", 
   RowBox[{"TransferMechanism", "\[Rule]", "Interrupts"}]}], "}"}]], "Output",\

 CellChangeTimes->{3.409500857086013*^9}]
}, Open  ]],

Cell["\<\
As an example if we were averaging and did not care about time and wanted to \
use Device 2 we would input\
\>", "Text",
 PageWidth->PaperWidth,
 ShowCellBracket->False],

Cell[BoxData[
 RowBox[{"GetVoltages", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"1", ",", "2"}], "}"}], ",", "5", ",", "1", ",", 
   RowBox[{"IncludeTime", "\[Rule]", "Omit"}], ",", 
   RowBox[{"Device", "\[Rule]", "2"}]}], "]"}]], "Input",
 PageWidth->PaperWidth,
 ShowCellBracket->False],

Cell["\<\
There are two other functions involved in sampling voltages.  They are \
GetVoltagesTrig and GetVoltagesDigTrig.  They have the following format:\
\>", "Text",
 PageWidth->PaperWidth,
 ShowCellBracket->False],

Cell[BoxData[
 RowBox[{"GetVoltagesTrig", "[", 
  StyleBox[
   RowBox[{"channel", ",", "frequency", ",", 
    RowBox[{"number", " ", "of", " ", "samples"}], ",", 
    RowBox[{"trigger", " ", "channel"}], ",", 
    RowBox[{"trigger", " ", "level"}]}],
   FontFamily->"Times",
   FontWeight->"Plain",
   FontSlant->"Italic"], "]"}]], "Input",
 PageWidth->PaperWidth,
 ShowCellBracket->False,
 Evaluatable->False],

Cell[BoxData[
 RowBox[{"GetVoltagesDigTrig", "[", 
  StyleBox[
   RowBox[{"channel", ",", "frequency", ",", 
    RowBox[{"number", " ", "of", " ", "samples"}], ",", " ", 
    RowBox[{"trigger", " ", "channel"}]}],
   FontFamily->"Times",
   FontWeight->"Plain",
   FontSlant->"Italic"], "]"}]], "Input",
 PageWidth->PaperWidth,
 ShowCellBracket->False,
 Evaluatable->False],

Cell["\<\
GetVoltagesTrig listens to trigger channel until the trigger level is reached \
and then begins recording.  GetVoltagesDigTrig is similar but uses a digital \
edge (0 and 5 volts) for triggering duty.  Again the channel argument must be \
a one dimensional list of integers in the correct range.  \
\>", "Text",
 PageWidth->PaperWidth,
 ShowCellBracket->False],

Cell["\<\
Both triggered functions share the same options as GetVoltages with the \
addition of the following.\
\>", "Text",
 PageWidth->PaperWidth,
 ShowCellBracket->False],

Cell[BoxData[GridBox[{
   {
    StyleBox["Option",
     FontVariations->{"Underline"->True}], 
    StyleBox[
     RowBox[{"Possible", " ", "Values"}],
     FontVariations->{"Underline"->True}], 
    StyleBox["Description",
     FontVariations->{"Underline"->True}]},
   {"TriggerSlope", 
    RowBox[{"Rising", "\[IndentingNewLine]", "Falling"}], 
    RowBox[{
    "This", " ", "option", " ", "controls", " ", "the", " ", "direction", " ",
      "in", " ", "which", " ", "the", " ", "trigger", " ", "is", " ", 
     "sensitive", " ", "to", " ", "the", " ", "sampled", " ", "voltage", " ", 
     "crossing", " ", "the", " ", "trigger", " ", "level", " ", 
     RowBox[{"threshold", ".", "  ", "The"}], " ", "default", " ", "is", " ", 
     
     RowBox[{"Rising", ".", "\[IndentingNewLine]", "\t\t"}]}]},
   {"PreTriggerSamples", 
    RowBox[{"Any", " ", "Integer"}], 
    RowBox[{
     RowBox[{
     "This", " ", "option", " ", "records", " ", "samples", " ", "that", " ", 
      "occured", " ", "previous", " ", "to", " ", "the", " ", "trigger", " ", 
      
      RowBox[{"event", ".", "  ", "If"}], " ", "the", " ", "event", " ", 
      "happens", " ", "before", " ", "the", " ", "specified", " ", "number", 
      " ", "of", " ", "pre"}], "-", 
     RowBox[{
     "trigger", " ", "samples", " ", "have", " ", "occured", " ", "all", " ", 
      "pre", " ", "trigger", " ", "samples", " ", "that", " ", "have", " ", 
      "been", " ", "taken", " ", "are", " ", 
      RowBox[{"returned", ".", "  ", "The"}], " ", "default", " ", "is", " ", 
      
      RowBox[{"zero", ".", "  ", "When"}], " ", "the", " ", "IncludeTime", 
      " ", "option", " ", "is", " ", "Include", " ", 
      RowBox[{"(", "default", ")"}], " ", "the", " ", "trigger", " ", "event",
       " ", "is", " ", "assigned", " ", "a", " ", "time", " ", "of", " ", 
      RowBox[{"zero", ".", "  ", "Pre"}], " ", "trigger", " ", "samples", " ",
       "have", " ", "negative", " ", 
      RowBox[{"times", "."}]}]}]}
  }]], "Text",
 CellFrame->True,
 ShowCellBracket->False,
 Background->RGBColor[1, 0.541482, 0.517891],
 GridBoxOptions->{
 GridBoxAlignment->{
  "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, "Rows" -> {{Top}}, 
   "RowsIndexed" -> {}},
 GridBoxItemSize->{
  "Columns" -> {10, 10, {30}}, "ColumnsIndexed" -> {}, "Rows" -> {{1.}}, 
   "RowsIndexed" -> {}},
 GridBoxSpacings->{"Columns" -> {
     Offset[0.27999999999999997`], {
      Offset[0.84]}, 
     Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
     Offset[0.2], {
      Offset[0.6]}, 
     Offset[0.2]}, "RowsIndexed" -> {}}}],

Cell["\<\
To trigger on a 8 volt falling edge signal on trigger channel 1  and take 100 \
post trigger samples with 50 pre trigger samples on channel 5 at a frequency \
of 25 Hz we would use the following:\
\>", "Text",
 PageWidth->PaperWidth,
 ShowCellBracket->False],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"GetVoltagesTrig", "[", 
  RowBox[{
   RowBox[{"{", "5", "}"}], ",", "25", ",", "100", ",", "1", ",", "8", ",", 
   RowBox[{"PreTriggerSamples", "\[Rule]", "50"}], ",", 
   RowBox[{"TriggerSlope", "\[Rule]", "Falling"}]}], "]"}]], "Input",
 PageWidth->PaperWidth,
 ShowCellBracket->False,
 CellChangeTimes->{3.409502407315133*^9, 3.4095024449192047`*^9}],

Cell[CellGroupData[{

Cell[BoxData["\<\"entering wait for trigger!\"\>"], "Print",
 CellChangeTimes->{3.4095024149761486`*^9}],

Cell[BoxData["\<\"inside wait for trig!\"\>"], "Print",
 CellChangeTimes->{3.4095024149961777`*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "2.`"}], ",", "0.44663191976896377`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.96`"}], ",", "0.4495522621162362`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.92`"}], ",", "0.4521481219840128`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.88`"}], ",", "0.4544194993710511`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.84`"}], ",", "0.45766432421411196`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.8`"}], ",", "0.4599357016073648`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.76`"}], ",", "0.4625315614885104`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.72`"}], ",", "0.4654519038588131`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.68`"}], ",", "0.4680477637471015`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.64`"}], ",", "0.4703191411521189`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.6`"}], ",", "0.47291500104673323`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.56`"}], ",", "0.4761598259197587`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.52`"}], ",", "0.4787556858219928`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.48`"}], ",", "0.4813515457276236`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.44`"}], ",", "0.48427188812552635`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.4`"}], ",", "0.4862187830598585`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.36`"}], ",", "0.489139125464959`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.32`"}], ",", "0.49205946787439`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.28`"}], ",", "0.4946553277975269`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.24`"}], ",", "0.49725118772409865`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.2`"}], ",", "0.5001715301456056`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.16`"}], ",", "0.5027673900794971`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.12`"}], ",", "0.505363250016843`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.08`"}], ",", "0.5079591099576495`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.04`"}], ",", "0.510879452395201`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1.`"}], ",", "0.513475312343382`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.96`"}], ",", "0.5160711722950428`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.92`"}], ",", "0.5183425497556057`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.88`"}], ",", "0.5212628922088295`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.84`"}], ",", "0.5235342696755091`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.8`"}], ",", "0.5264546121366112`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.76`"}], ",", "0.5284015071131474`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.72`"}], ",", "0.531970814575269`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.68`"}], ",", "0.534891157049233`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.64`"}], ",", "0.5368380520343581`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.6`"}], ",", "0.5394339120176194`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.56`"}], ",", "0.5420297720044229`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.52`"}], ",", "0.5446256319947751`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.48`"}], ",", "0.5475459744881707`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.44`"}], ",", "0.550141834486084`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.4`"}], ",", "0.5527376944875654`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.36`"}], ",", "0.555333554492621`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.32`"}], ",", "0.557929414501257`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.28`"}], ",", "0.56084975701526`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.24`"}], ",", "0.5637700995338113`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.2`"}], ",", "0.5663659595541267`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.16`"}], ",", "0.568961819578049`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.12`"}], ",", "0.5725311271168431`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.08`"}], ",", 
     RowBox[{"-", "1.7968393964336042`"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "0.04`"}], ",", "0.4226202161832072`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.`", ",", "2.4574513440143657`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.04`", ",", "2.4587492761664085`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.08`", ",", "2.459722725281777`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.12`", ",", "2.461020657437385`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.16`", ",", "2.4616696235159523`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.2`", ",", "2.46231858959503`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.24`", ",", "2.4629675556746173`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.28`", ",", "2.4636165217547137`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.32`", ",", "2.463941004794954`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.36`", ",", "2.4645899708758154`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.4`", ",", "2.4649144539164376`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.44`", ",", "2.4655634199980643`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.48`", ",", "2.4658879030390692`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.52`", ",", "2.4658879030390692`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.56`", ",", "2.466861352162849`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.6`", ",", "2.466861352162849`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.64`", ",", "2.466861352162849`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.68`", ",", "2.4678348012877764`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.72`", ",", "2.467510318246006`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.76`", ",", "2.4678348012877764`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.8`", ",", "2.4684837673716995`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.84`", ",", "2.4684837673716995`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.88`", ",", "2.468808250413853`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.92`", ",", "2.4691327334561337`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0.96`", ",", "2.4691327334561337`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.`", ",", "2.4691327334561337`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.04`", ",", "2.469457216498542`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.08`", ",", "2.469457216498542`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.12`", ",", "2.4697816995410777`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.16`", ",", "2.470106182583742`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.2`", ",", "2.470106182583742`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.24`", ",", "2.4704306656265334`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.28`", ",", "2.470106182583742`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.32`", ",", "2.470755148669453`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.36`", ",", "2.4704306656265334`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.4`", ",", "2.4697816995410777`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.44`", ",", "2.4655634199980643`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.48`", ",", "2.2507556742538997`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.52`", ",", "2.0142076279810746`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.56`", ",", "1.7341789464897908`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.6`", ",", "1.4940617126570206`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.64`", ",", "2.4710796317124997`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.68`", ",", "2.471728597798977`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.72`", ",", "2.4714041147556745`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.76`", ",", "2.4714041147556745`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.8`", ",", "2.471728597798977`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.84`", ",", "2.471728597798977`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.88`", ",", "2.471728597798977`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.92`", ",", "2.4720530808424073`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"1.96`", ",", "2.471728597798977`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.`", ",", "2.4720530808424073`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.04`", ",", "2.471728597798977`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.08`", ",", "2.4723775638859653`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.12`", ",", "2.4720530808424073`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.16`", ",", "2.4720530808424073`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.2`", ",", "2.4720530808424073`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.24`", ",", "2.4720530808424073`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.28`", ",", "2.472702046929651`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.32`", ",", "2.4720530808424073`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.36`", ",", "2.4723775638859653`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.4`", ",", "2.4723775638859653`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.44`", ",", "2.4720530808424073`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.48`", ",", "2.4723775638859653`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.52`", ",", "2.4723775638859653`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.56`", ",", "2.472702046929651`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.6`", ",", "2.472702046929651`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.64`", ",", "2.472702046929651`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.68`", ",", "2.472702046929651`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.72`", ",", "2.4730265299734646`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.76`", ",", "2.472702046929651`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.8`", ",", "2.4730265299734646`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.84`", ",", "2.4730265299734646`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.88`", ",", "2.472702046929651`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.92`", ",", "2.4730265299734646`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2.96`", ",", "2.4723775638859653`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.`", ",", "2.4710796317124997`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.04`", ",", "2.4684837673716995`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.08`", ",", "2.273469481689554`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.12`", ",", "2.03400108358057`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.16`", ",", "1.8230872332046784`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.2`", ",", "2.2617880949349747`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.24`", ",", "2.131345953267514`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.28`", ",", "1.9373051896150908`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.32`", ",", "1.8477479272354613`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.36`", ",", "1.7001082546816098`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.4`", ",", "1.552468602592285`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.44`", ",", "1.421053104381642`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.48`", ",", "1.2133841981772093`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.52`", ",", "1.0848890792010861`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.56`", ",", "0.8697571259306414`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.6`", ",", "0.6899937973100639`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.64`", ",", "0.5342421920546327`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.68`", ",", "0.338254773332554`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.72`", ",", "0.19742938736003998`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.76`", ",", "0.01214991693755613`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.8`", ",", 
     RowBox[{"-", "0.14944232617413925`"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.84`", ",", 
     RowBox[{"-", "0.2649580616535976`"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.88`", ",", 
     RowBox[{"-", "0.4129220328459713`"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.92`", ",", 
     RowBox[{"-", "0.4499130249604644`"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"3.96`", ",", 
     RowBox[{"-", "0.5475822223446116`"}]}], "}"}]}], "}"}]], "Output",
 CellChangeTimes->{3.409502427323904*^9}]
}, Open  ]],

Cell["\<\

\
\>", "Text",
 PageWidth->PaperWidth,
 ShowCellBracket->False,
 FontSize->3]
}, Open  ]],

Cell[CellGroupData[{

Cell["Exporting Voltages", "Subtitle",
 PageWidth->PaperWidth,
 CellFrame->{{0, 0}, {0, 2}},
 CellDingbat->"\[FilledSquare]",
 ShowCellBracket->False,
 FontSize->16,
 FontColor->RGBColor[1, 0.541482, 0.517891]],

Cell["\<\
Along with the three functions with importing capability, there are also two \
functions for outputting voltages to the data acquisition card.  The first is\
\
\>", "Text",
 PageWidth->PaperWidth,
 ShowCellBracket->False],

Cell[BoxData[
 RowBox[{"OutputVoltage", "[", 
  StyleBox[
   RowBox[{"channel", ",", "voltage"}],
   FontFamily->"Times",
   FontWeight->"Plain",
   FontSlant->"Italic"], "]"}]], "Input",
 PageWidth->PaperWidth,
 ShowCellBracket->False,
 Evaluatable->False],

Cell["\<\
This function simply outputs voltage on the specified channel.  In this case \
channel is an integer in the range 1 to 8 (inclusive).  The voltage on the \
corresponding pin does not change until a different voltage is sent to the \
same channel.  OutputVoltage also has the Device, MinValue, MaxValue, Units, \
TimeOut, and MessageLevel options described above.  \
\>", "Text",
 PageWidth->PaperWidth,
 ShowCellBracket->False],

Cell["The second function that has an export ability is ", "Text",
 PageWidth->PaperWidth,
 ShowCellBracket->False],

Cell[BoxData[
 RowBox[{"OutputWaveform", "[", 
  StyleBox[
   RowBox[{
    RowBox[{"channel", " ", "list"}], ",", 
    RowBox[{"waveform", " ", "list"}], ",", " ", "frequency", ",", " ", 
    RowBox[{"number", " ", "of", " ", "periods"}]}],
   FontFamily->"Times",
   FontWeight->"Plain",
   FontSlant->"Italic"], "]"}]], "Input",
 PageWidth->PaperWidth,
 ShowCellBracket->False,
 Evaluatable->False,
 CellChangeTimes->{{3.409502489042651*^9, 3.4095024918566976`*^9}}],

Cell["\<\
The channel list argument must be {0}, {1}, or {0,1}, corresponding to the \
two output pins on the data acquisition card.  The waveform list must be a \
list of real numbers within the range from MinValue to MaxValue.  This \
function steps through the waveform list at the specified frequency \
outputting the values as voltages for the required number of periods.  It \
shares the Device, MinValue, MaxValue, Units, ClockSource, ActiveEdge, \
SampleMode, TimeOut, and MessageLevel options discussed above.  In addition \
it has the TransferMechanism option discussed below.  If the SampleMode \
option is specified as Continuous the number of periods argument is ignored \
but still required, and the waveform keeps repeating.  In this case the user \
is returned a task handle number that allows them to quit the waveform \
output.  This is done with the ClearTask function discussed below.   \
\>", "Text",
 PageWidth->PaperWidth,
 ShowCellBracket->False,
 CellChangeTimes->{{3.409502477586178*^9, 3.409502485036891*^9}}],

Cell[BoxData[{GridBox[{
   {
    StyleBox["Option",
     FontVariations->{"Underline"->True}], 
    StyleBox[
     RowBox[{"Possible", " ", "Values"}],
     FontVariations->{"Underline"->True}], 
    StyleBox["Description",
     FontVariations->{"Underline"->True}]},
   {"TransferMechanism", 
    RowBox[{"Interrupts", "\[IndentingNewLine]", "DMA"}], 
    RowBox[{
    "DMA", " ", "is", " ", "direct", " ", "memory", " ", "access", " ", "in", 
     " ", "which", " ", "the", " ", "card", " ", "writes", " ", "data", " ", 
     "directly", " ", "to", " ", "computer", " ", 
     RowBox[{"memory", ".", "  ", "Interrupts"}], " ", "uses", " ", "memory", 
     " ", "allocated", " ", "on", " ", "the", " ", "DAQ", " ", "card", " ", 
     "and", " ", "is", " ", "the", " ", 
     RowBox[{"default", "."}]}]}
  }], "\[IndentingNewLine]", GridBox[{
   {"SampleMode", 
    RowBox[{"Continuous", "\[IndentingNewLine]", "Finite"}], 
    RowBox[{
    "Continuous", "  ", "outputs", " ", "voltages", " ", "continuously", " ", 
     "and", " ", "ignores", " ", "the", " ", "number", " ", "of", " ", 
     "samples", " ", "and", " ", "number", " ", "of", " ", "periods", " ", 
     "arguments", " ", 
     RowBox[{
      RowBox[{"(", 
       RowBox[{
       "which", " ", "are", " ", "still", " ", "required", " ", "as", " ", 
        "input"}], ")"}], ".", "\[IndentingNewLine]", 
      "\t\t\t\t\t\t\t\t\t\t\t\t"}]}]}
  }]}], "Text",
 CellFrame->True,
 ShowCellBracket->False,
 Background->RGBColor[1, 0.541482, 0.517891],
 GridBoxOptions->{
 GridBoxAlignment->{
  "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, "Rows" -> {{Top}}, 
   "RowsIndexed" -> {}},
 GridBoxItemSize->{
  "Columns" -> {10, 10, {30}}, "ColumnsIndexed" -> {}, "Rows" -> {{1.}}, 
   "RowsIndexed" -> {}},
 GridBoxSpacings->{"Columns" -> {
     Offset[0.27999999999999997`], {
      Offset[0.84]}, 
     Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
     Offset[0.2], {
      Offset[0.6]}, 
     Offset[0.2]}, "RowsIndexed" -> {}}}],

Cell["\<\
A sample implementation of this function may be to send out the list {-1,0,1} \
for three periods at 10 Hz on channel 1.\
\>", "Text",
 PageWidth->PaperWidth,
 ShowCellBracket->False],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"OutputWaveform", "[", 
  RowBox[{
   RowBox[{"{", "1", "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "1"}], ",", "0", ",", "1"}], "}"}], ",", "10", ",", "3"}], 
  "]"}]], "Input",
 PageWidth->PaperWidth,
 ShowCellBracket->False,
 CellChangeTimes->{{3.4095009250938034`*^9, 3.409500927697547*^9}, {
  3.4095009636792865`*^9, 3.409501011668291*^9}, {3.4095011176006145`*^9, 
  3.4095011177608447`*^9}, {3.409501174492421*^9, 3.4095011764852867`*^9}, {
  3.4095020504419746`*^9, 3.4095020619385056`*^9}}],

Cell[BoxData["1842461792"], "Output",
 CellChangeTimes->{{3.4095009037731457`*^9, 3.40950102195308*^9}, 
   3.409501089580323*^9, {3.409501131310328*^9, 3.409501177937374*^9}, {
   3.4095020330569763`*^9, 3.4095020516437025`*^9}}]
}, Open  ]],

Cell["\<\
When outputting a continuous waveform we get a task handle number back.\
\>", "Text",
 PageWidth->PaperWidth,
 ShowCellBracket->False],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"th", " ", "=", 
  RowBox[{"OutputWaveform", "[", 
   RowBox[{
    RowBox[{"{", "1", "}"}], ",", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"-", "1"}], ",", "0", ",", "1"}], "}"}], ",", "10", ",", "3", 
    ",", 
    RowBox[{"SampleMode", "\[Rule]", "Continuous"}]}], "]"}]}]], "Input",
 ShowCellBracket->False,
 CellChangeTimes->{{3.40950122724828*^9, 3.4095012301424417`*^9}, {
  3.409501287735256*^9, 3.4095012888869123`*^9}, {3.409501491958915*^9, 
  3.4095015032050867`*^9}}],

Cell[BoxData["\<\"continuous output should be happening!\"\>"], "Print",
 CellChangeTimes->{3.409501680199592*^9, 3.409502070220414*^9}],

Cell[BoxData["1842461792"], "Output",
 CellChangeTimes->{3.4095016803097506`*^9, 3.4095020703005295`*^9}]
}, Open  ]],

Cell["\<\
To clear the task use the taskhandlel and the ClearTask Function.\
\>", "Text",
 CellChangeTimes->{{3.4095019796902385`*^9, 3.409502026327299*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"ClearTask", "[", "th", "]"}]], "Input",
 ShowCellBracket->False,
 CellChangeTimes->{{3.40950122724828*^9, 3.4095012301424417`*^9}, {
  3.409501287735256*^9, 3.4095012888869123`*^9}, {3.409501491958915*^9, 
  3.4095015520553293`*^9}}],

Cell[BoxData["0"], "Output",
 CellChangeTimes->{
  3.409501181632688*^9, {3.409501221510029*^9, 3.4095012318248606`*^9}, 
   3.409501317948701*^9, {3.4095015153225107`*^9, 3.4095015291423826`*^9}, 
   3.4095016843455534`*^9, 3.409502073445051*^9}]
}, Open  ]],

Cell["", "Text",
 PageWidth->PaperWidth,
 ShowCellBracket->False,
 CellChangeTimes->{3.409501560928088*^9}],

Cell[BoxData[""], "Input",
 PageWidth->PaperWidth,
 ShowCellBracket->False,
 Evaluatable->False,
 CellChangeTimes->{
  3.4095012658938494`*^9, {3.4095013230159874`*^9, 3.409501339870222*^9}}],

Cell[BoxData[""], "Input",
 PageWidth->PaperWidth,
 ShowCellBracket->False,
 Evaluatable->False,
 CellChangeTimes->{
  3.4095012658938494`*^9, {3.4095013230159874`*^9, 3.409501339870222*^9}, {
   3.40950145006868*^9, 3.4095014529628415`*^9}, 3.4095015104154544`*^9, {
   3.409501632090414*^9, 3.409501632651221*^9}}],

Cell["\<\

\
\>", "Text",
 PageWidth->PaperWidth,
 ShowCellBracket->False,
 FontSize->2]
}, Open  ]],

Cell[CellGroupData[{

Cell["Trouble-Shooting", "Subtitle",
 PageWidth->PaperWidth,
 CellFrame->{{0, 0}, {0, 2}},
 CellDingbat->"\[FilledSquare]",
 ShowCellBracket->False,
 FontSize->16,
 FontColor->RGBColor[1, 0.541482, 0.517891]],

Cell["\<\
Because the C++ code is very specific about what we pass it through the \
Mathlink interface, fairly rigorous error checking is implemented before \
those functions controlling the board are actually called.  The MessageLevel \
option is useful for understanding what the C++ code receives.  Upon any \
mistakes by the user a useful (hopefully) error message should be returned \
detailing the error.   For example, if one of the elements of our list in \
OutputWaveform is not a real number we get the following:\
\>", "Text",
 PageWidth->PaperWidth,
 ShowCellBracket->False],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"OutputWaveform", "[", 
  RowBox[{"1", ",", 
   RowBox[{"{", 
    RowBox[{"2", ",", "3", ",", 
     RowBox[{"1", "+", 
      RowBox[{"4", "I"}]}]}], "}"}], ",", "10", ",", "3"}], "]"}]], "Input",
 PageWidth->PaperWidth,
 ShowCellBracket->False],

Cell[BoxData["\<\"Error: All of the elements of the argument Waveform (list) \
must be real numbers.\"\>"], "Print",
 ShowCellBracket->False],

Cell[BoxData["$Aborted"], "Output",
 ShowCellBracket->False]
}, Open  ]],

Cell["\<\
If one of the list elements is out of range (the default is  -10 to 10) we \
get the following error message:\
\>", "Text",
 ShowCellBracket->False],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"OutputWaveform", "[", 
  RowBox[{"1", ",", 
   RowBox[{"{", 
    RowBox[{"2", ",", "3", ",", "11"}], "}"}], ",", "10", ",", "3"}], 
  "]"}]], "Input",
 ShowCellBracket->False],

Cell[BoxData["\<\"Error: All elements of the Waveform argument list must be \
within the range of MinValue to MaxValue.\"\>"], "Print",
 ShowCellBracket->False],

Cell[BoxData["$Aborted"], "Output",
 ShowCellBracket->False]
}, Open  ]],

Cell["\<\
Numerous error messages similar to those above have been created to aid the \
user.  \
\>", "Text",
 ShowCellBracket->False],

Cell["\<\
It is possible that the Mathlink interface can become confused so we have \
included the ReDoLink function that resets the link to the card controlling \
software.  Evaluating this command destroys and recreates the link.  Not \
working in version 6 for the moment.\
\>", "Text",
 PageWidth->PaperWidth,
 ShowCellBracket->False,
 CellChangeTimes->{{3.409502141613072*^9, 3.4095021616018143`*^9}}],

Cell[BoxData[
 RowBox[{"ReDoLink", "[", "]"}]], "Input",
 PageWidth->PaperWidth,
 ShowCellBracket->False],

Cell["\<\
The link is automatically set up when the package is loaded.  If the link is \
somehow destroyed externally this function should re-establish the \
connection.\
\>", "Text",
 PageWidth->PaperWidth,
 ShowCellBracket->False],

Cell["To summarize, the available functions are", "Text",
 PageWidth->PaperWidth,
 CellFrame->{{0, 0}, {0, 2}},
 ShowCellBracket->False],

Cell["\<\
GetVoltages
GetVoltagesTrig
GetVoltagesDigTrig
OutputVoltage
OutputWaveform
ClearTask
ReDoLink\
\>", "Text",
 PageWidth->PaperWidth,
 CellFrame->True,
 ShowCellBracket->False,
 ShowCellTags->True,
 Background->RGBColor[1, 0.541482, 0.517891]]
}, Open  ]]
}, Open  ]]
},
WindowSize->{950, 602},
WindowMargins->{{13, Automatic}, {Automatic, 0}},
ShowSelection->True,
ShowCellTags->True,
FrontEndVersion->"6.0 for Microsoft Windows (32-bit) (April 20, 2007)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{
 "Info3409472023-1192298"->{
  Cell[8037, 220, 221, 4, 54, "Print",
   CellTags->"Info3409472023-1192298"]}
 }
*)
(*CellTagsIndex
CellTagsIndex->{
 {"Info3409472023-1192298", 46793, 1306}
 }
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[590, 23, 201, 6, 79, "Title"],
Cell[794, 31, 1183, 23, 137, "Text"],
Cell[1980, 56, 89, 2, 29, "Text"],
Cell[CellGroupData[{
Cell[2094, 62, 110, 2, 31, "Input"],
Cell[2207, 66, 299, 5, 23, "Print"]
}, Open  ]],
Cell[2521, 74, 121, 2, 29, "Text"],
Cell[CellGroupData[{
Cell[2667, 80, 211, 6, 50, "Subtitle"],
Cell[2881, 88, 164, 4, 29, "Text"],
Cell[3048, 94, 316, 10, 31, "Input",
 Evaluatable->False],
Cell[3367, 106, 831, 15, 119, "Text"],
Cell[4201, 123, 256, 9, 31, "Input"],
Cell[4460, 134, 412, 8, 47, "Text"],
Cell[CellGroupData[{
Cell[4897, 146, 351, 10, 31, "Input"],
Cell[5251, 158, 2586, 50, 221, "Output"]
}, Open  ]],
Cell[7852, 211, 78, 1, 29, "Text"],
Cell[CellGroupData[{
Cell[7955, 216, 79, 2, 31, "Input"],
Cell[8037, 220, 221, 4, 54, "Print",
 CellTags->"Info3409472023-1192298"]
}, Open  ]],
Cell[8273, 227, 188, 5, 29, "Text"],
Cell[8464, 234, 6482, 143, 771, "Text"],
Cell[14949, 379, 121, 3, 29, "Text"],
Cell[CellGroupData[{
Cell[15095, 386, 70, 1, 31, "Input"],
Cell[15168, 389, 808, 18, 69, "Output"]
}, Open  ]],
Cell[15991, 410, 179, 5, 47, "Text"],
Cell[16173, 417, 293, 8, 31, "Input"],
Cell[16469, 427, 218, 5, 47, "Text"],
Cell[16690, 434, 410, 12, 52, "Input",
 Evaluatable->False],
Cell[17103, 448, 373, 11, 52, "Input",
 Evaluatable->False],
Cell[17479, 461, 370, 7, 83, "Text"],
Cell[17852, 470, 173, 5, 47, "Text"],
Cell[18028, 477, 2589, 59, 277, "Text"],
Cell[20620, 538, 268, 6, 65, "Text"],
Cell[CellGroupData[{
Cell[20913, 548, 377, 8, 52, "Input"],
Cell[CellGroupData[{
Cell[21315, 560, 104, 1, 23, "Print"],
Cell[21422, 563, 99, 1, 23, "Print"]
}, Open  ]],
Cell[21536, 567, 13343, 359, 449, "Output"]
}, Open  ]],
Cell[34894, 929, 88, 6, 26, "Text"]
}, Open  ]],
Cell[CellGroupData[{
Cell[35019, 940, 210, 6, 50, "Subtitle"],
Cell[35232, 948, 231, 6, 47, "Text"],
Cell[35466, 956, 257, 9, 31, "Input",
 Evaluatable->False],
Cell[35726, 967, 437, 8, 101, "Text"],
Cell[36166, 977, 115, 2, 29, "Text"],
Cell[36284, 981, 468, 13, 31, "Input",
 Evaluatable->False],
Cell[36755, 996, 1036, 16, 209, "Text"],
Cell[37794, 1014, 2012, 50, 194, "Text"],
Cell[39809, 1066, 193, 5, 47, "Text"],
Cell[CellGroupData[{
Cell[40027, 1075, 540, 13, 31, "Input"],
Cell[40570, 1090, 230, 3, 30, "Output"]
}, Open  ]],
Cell[40815, 1096, 144, 4, 29, "Text"],
Cell[CellGroupData[{
Cell[40984, 1104, 507, 13, 31, "Input"],
Cell[41494, 1119, 136, 1, 23, "Print"],
Cell[41633, 1122, 105, 1, 30, "Output"]
}, Open  ]],
Cell[41753, 1126, 157, 3, 29, "Text"],
Cell[CellGroupData[{
Cell[41935, 1133, 257, 5, 31, "Input"],
Cell[42195, 1140, 247, 4, 30, "Output"]
}, Open  ]],
Cell[42457, 1147, 107, 3, 29, "Text"],
Cell[42567, 1152, 191, 5, 31, "Input",
 Evaluatable->False],
Cell[42761, 1159, 316, 7, 31, "Input",
 Evaluatable->False],
Cell[43080, 1168, 88, 6, 26, "Text"]
}, Open  ]],
Cell[CellGroupData[{
Cell[43205, 1179, 208, 6, 50, "Subtitle"],
Cell[43416, 1187, 586, 10, 119, "Text"],
Cell[CellGroupData[{
Cell[44027, 1201, 267, 8, 31, "Input"],
Cell[44297, 1211, 141, 2, 23, "Print"],
Cell[44441, 1215, 60, 1, 30, "Output"]
}, Open  ]],
Cell[44516, 1219, 158, 4, 29, "Text"],
Cell[CellGroupData[{
Cell[44699, 1227, 199, 6, 31, "Input"],
Cell[44901, 1235, 160, 2, 23, "Print"],
Cell[45064, 1239, 60, 1, 30, "Output"]
}, Open  ]],
Cell[45139, 1243, 134, 4, 29, "Text"],
Cell[45276, 1249, 406, 8, 65, "Text"],
Cell[45685, 1259, 105, 3, 31, "Input"],
Cell[45793, 1264, 232, 6, 47, "Text"],
Cell[46028, 1272, 136, 3, 39, "Text"],
Cell[46167, 1277, 252, 13, 153, "Text"]
}, Open  ]]
}, Open  ]]
}
]
*)

(* End of internal cache information *)
